<template>
  <div>
    {{ currentValue }}
    <button   @click="handleClick1">Click</button>
  </div>
</template>

<script>
import {ref,defineComponent} from "vue";

export default defineComponent({
  name: "custom",
  props: {
    value: {
      type: Number,
      default: 0
    }
  },
  setup(props, context) {
    let currentValue = ref(0)
    const handleClick1 = () => {
      this.currentValue += 1
      console.log(this.currentValue,'123')
      context.emit('input', this.currentValue)

    }
    return {
      currentValue,
      handleClick1
    }
  }
})
</script>

<style scoped>

</style>
